﻿@model System.Web.Mvc.HandleErrorInfo
@using Jb.Common.Extensions;
@{
    String pageTitle = "Error Processing Request"; 
    ViewBag.Title = Html.GetPageTitle(pageTitle);
    Exception _Ex = Server.GetLastError();
}

<div class="jb-page-heading">
    <h1>@pageTitle</h1>
    <div>
        Send your <a href="/Feedback">feedback</a> directly to the @ConfigReader.SiteName team.        
    </div>
</div>

<div class="jb-page-content">
    @Html.WarningMessageBox("Sorry, an error occurred while processing your request.")

    @if (ConfigReader.ShowDetailedError && _Ex != null)
    {
        if (_Ex.InnerException == null)
        {
            <h2 style='color:maroon;'><i>@_Ex.Message</i></h2>
            <b><u>Stack Trace:</u></b><br/>@_Ex.StackTrace<br/>
        }
        else
        {
            <h2 style='color:maroon;'><i>@_Ex.InnerException.Message</i></h2>
            if (_Ex.InnerException.StackTrace.IsNullOrEmpty())
            {
                <b><u>Stack Trace:</u></b><br/>@_Ex.StackTrace<br/>
            }
            else
            {
                <b><u>InnerException Stack Trace:</u></b><br/>@_Ex.InnerException.StackTrace<br/>
            }
        }
    }
</div>
